﻿using StaffModule.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace StaffModule.Models {
    /// <summary>
    /// 缺岗信息
    /// </summary>
     public class Vacancy : INotifyPropertyChanged {
        //属性变更通知
        public event PropertyChangedEventHandler? PropertyChanged;
        //姓名
        private string _StuffName;

        public string StuffName {
            get { return _StuffName; }
            set {
                _StuffName = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("StuffName"));
            }
        }

        //职位
        private string _Position;

        public string Position {
            get { return _Position; }
            set { _Position = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Position"));
            }
        }
        /// <summary>
        /// 缺岗次数
        /// </summary>
        private int _OutWorkCount;

        public int OutWorkCount {
            get { return _OutWorkCount; }
            set { _OutWorkCount = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("OutWorkCount"));
            }
        }


        /// <summary>
        /// 界面显示宽度
        /// </summary>
        /// 
        private int _ShowWidth;
        public int ShowWidth {
            get {
                try {
                   int a=OutWorkCount * 70 / 100;
                } catch (DivideByZeroException ex) {
                    MessageBox.Show(ex.Message);
                }
                return OutWorkCount * 70 / 100;
            }
            set { _ShowWidth = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ShowWidth"));
            }
        }


    }
}
